IPL(INDIAN PREMIER LEAGUE) Data Conversion from .yaml to .xlsx

Created by Shubbh Rajehskumar Mewada. 21f1005150@student.onlinedegree.iitm.ac.in


Step 1:

Import all the neccessary libraries.

Step 2:

Create a Dictionary named 'yaml2excel' in which we will store all the data from .yaml files and when all the data is finally recorded, we will convert this dictionary into a DataFrame using Pandas which will inturn be converted into Microsoft excel (.xlsx) file.

Step 3:

To make this process easier, I've distinguished each and every attributes of IPL data from .yaml file into a List inorder to make it easier to record.

Step 4:

: Here comes the most important part, I've created a function 'converter' which will just record all the data from the arguement 'document' which is in a dictionary format, we extracted entire data from .yaml file and converted it into dictionary. If it looks too confusing, just skip this part for the time being.

Step 5:

: If you see too many 'try' and 'except' blocks, it's used incase the data from the arguement is not as per our prediction.

Step 6:

Let me explain this in a simple way, Suppose, that you have a folder named 'Messi_Left_Barca' and inside that folder you have many files and some of the files are named as 'Messi_Joined_PSG.psg', 'Neymar_In_PSG.psg', 'Ronaldo_Back_At_OldTrafford.mu'. Our aim here is to extract all those files whose extension is '.psg' from the folder 'Messi_Left_Barca'. This aim can be fullfilled by the below written code.

Step 7:

We need all the files with .yaml extension.

Step 8:

Just so we know that we are going in the right direction, I've added a print statement which will display our location.

Step 9:

We convert our dictionary 'yaml2excel' into a Data Frame.

Step 10:

We use a Function called '.to_excel' which will convert our Data Frame into an excel sheet. Hence we successfully completed our task of converting .yaml file to .xlsx file


Data Filtering Starts from Here!!

Finding Conclusion with the Data

1) Printing Our Data Frame.

Which Team has won the most number of times?

Using Filters and Grouping the data.

After Using Filters.

Graphical Representation.

Created by Shubbh Rajehskumar Mewada. 21f1005150@student.onlinedegree.iitm.ac.in